projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4b295f
)
Fix use-after-free of temp in gbfile. That gets Ubuntu back to a happy place.
author
robertlipe
<robertlipe@gmail.com>
Sun, 10 Feb 2013 03:38:11 +0000
(
03:38
+0000)
committer
robertlipe
<robertlipe@gmail.com>
Sun, 10 Feb 2013 03:38:11 +0000
(
03:38
+0000)
gpsbabel/gbfile.cc
patch
|
blob
|
history
diff --git
a/gpsbabel/gbfile.cc
b/gpsbabel/gbfile.cc
index 2cbd8edbb2bca9558e240353fc1bc47f0b42c648..376d2b2c83f3fc46cc0fe531bc712390479a64f5 100644
(file)
--- a/
gpsbabel/gbfile.cc
+++ b/
gpsbabel/gbfile.cc
@@
-28,6
+28,7
@@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <QtCore/QDebug>
#if __WIN32__
@@
-779,9
+780,11
@@
gbfputs(const char* s, gbfile* file)
int
gbfputs(const QString& s, gbfile* file)
{
- const char* qs =
s.toUtf8().data(
);
+ const char* qs =
xstrdup(s.toUtf8().data()
);
unsigned int l = strlen(qs);
- return gbfwrite(qs, 1, l, file);
+ int rv = gbfwrite(qs, 1, l, file);
+ xfree(qs);
+ return rv;
}
/*